﻿// <copyright file="VirtualRegistryEntryDWordValue.cs" company="Sinclair Community College">
// Copyright 2010 Sinclair Community College
// </copyright>
// <originalAuthor>Patrick S. Seymour (patrick.seymour@gmail.com)</originalAuthor>

namespace SinclairCC.AppV
{
    using System;

    /// <summary>
    /// This class represents a virtual registry entry that contains a DWord value.
    /// </summary>
    internal class VirtualRegistryEntryDWordValue : VirtualRegistryEntryValue
    {
        /// <summary>
        /// Initializes a new instance of the VirtualRegistryEntryDWordValue class.
        /// </summary>
        /// <param name="rawData">
        /// The raw data registry data contained in the CP file.
        /// </param>
        public VirtualRegistryEntryDWordValue(byte[] rawData)
            : base(rawData)
        {
        }

        /// <summary>
        /// Gets a long value containing the value stored in the registry entry.
        /// </summary>
        public long Value
        {
            get { return BitConverter.ToInt32(this.RawValue, 0); }
        }

        /// <summary>
        /// Creates a string representation of the registry value.
        /// </summary>
        /// <returns>
        /// Returns a string representation of the registry value.
        /// </returns>
        public override string ToString()
        {
            return this.Value.ToString();
        }
    }
}
